package com.ysdz.tibetan.tibetanmini.product.beans;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Id;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class CategoryVO {

    List<CategoryDetail> children;

    public CategoryVO(Category category) {
        this.categoryId = category.getCategoryId();
        this.categoryName = category.getCategoryName();
        this.categoryLevel = category.getCategoryLevel();
        this.parentId = category.getParentId();
        this.categoryIcon = category.getCategoryIcon();
        this.categoryTibetanName = category.getCategoryTibetanName();
    }

    /**
     * 主键 分类id主键
     */
    @Id
    @Column(name = "category_id")
    private Integer categoryId;

    /**
     * 分类名称 分类名称
     */
    @Column(name = "category_name")
    private String categoryName;

    /**
     * 分类层级 分类得类型，
1:一级大分类
2:二级分类
3:三级小分类
     */
    @Column(name = "category_level")
    private Integer categoryLevel;

    /**
     * 父层级id 父id 上一级依赖的id，1级分类则为0，二级三级分别依赖上一级
     */
    @Column(name = "parent_id")
    private Integer parentId;

    /**
     * 图标 logo
     */
    @Column(name = "category_icon")
    private String categoryIcon;

    @Column(name = "category_tibetan_name")
    private String categoryTibetanName;

}